const { default: service } = require('@/utils/request')

// 获取企业的数据列表
export const getEnterpriseAPI = (params) => {
  return service({
    url: 'park/enterprise',
    params
  })
}

// 获取行业列表
export const getIndustryList = () => {
  return service({
    url: '/park/industry'
  })
}

// 上传文件
export const uploadIndustryFileAPI = (data) => {
  return service({
    method: 'post',
    url: '/upload',
    data
  })
}

// 添加企业信息 https://api-hmzs.itheima.net/api/park/enterprise
export const addenterpriseApi = (data) => {
  return service({
    method: 'post',
    url: '/park/enterprise',
    data
  })
}

// 添加合同信息 https://api-hmzs.itheima.net/api/park/enterprise/rent
export const addrentApi = (data) => {
  return service({
    url: '/park/enterprise/rent',
    method: 'post',
    data
  })
}

// 展开查看
export const expandViewApi = (id) => {
  return service({
    url: `/park/enterprise/rent/${id}`
  })
}

// 退租 https://api-hmzs.itheima.net/api/park/enterprise/rent/{id}
export const rentTerminationApi = (id) => {
  return service({
    method: 'put',
    url: `/park/enterprise/rent/${id}`
  })
}

// 查看企业详细信息 https://api-hmzs.itheima.net/api/park/enterprise/{id}
export const enterpriseDetailInfoApi = (id) => {
  return service({
    url: `park/enterprise/${id}`
  })
}

// 下载合同文件
export const uploaddownloadApi = (id) => {
  return service({
    url: `/download/${id}`,
    responseType: 'blob'
  })
}
